//质因数分解.
//e.g: 28 became 2 * 2 * 7.
#include <stdio.h>
int is_prime(int n)
{
    for(int i = 2; i < n / 2; i++)
    {
        if(n % i == 0)
        {
            return 1;
        }
    }

    return -1;
}

void zhiyinshufenjie(int n)
{
    int i = 0, j;
    int m = n;
    for(j = 2; j < m / 2; j++)
    {
        while(n % j == 0)
        {
            printf("%d * ", j);
            n /= j;
        }
    }

}

int main(void)
{
    int n;
    int c;
    printf("Enter a integer:\n");
    scanf("%d", &n);
    c = is_prime(n);

    if(c)
    {
        zhiyinshufenjie(n);
    }
    else
    {
        printf("it is a prime");
    }

    printf("\nhello\n");
    return 0;
}